package com.bryandismas.pcsx;

import com.bryandismas.pcsx.gui.TempGUI;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;

public class PcsxAndroid extends Activity 
{
	PcsxCore core;
	TempGUI gui;
	
	// Activity request codes..
	public static int REQUEST_ISO = 1;
	
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
    	requestWindowFeature(Window.FEATURE_NO_TITLE);
    	this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    	
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        gui = new TempGUI(this);
        
        core = new PcsxCore(this);
        core.load();
    }
    
    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data)
    {
    	if (resultCode == 1)
    	{
	    	if (requestCode == PcsxAndroid.REQUEST_ISO)
	    	{
	    		// coming from the file chooser!
	    		core.bindings.alertBox("Pcsx Android", data.getExtras().getString("SelectedFile"));
	    		
	    		// start the emulator.
	    		Intent intent = new Intent("pcsx.emulator.START");
	    		startActivity(intent);
	    	}
    	}
    }
}